#pragma once

#include "Containers/Optional.h"
#include "Containers/Map.h"
#include "Containers/Any.h"
#include "Containers/String.h"
#include "Reflection/NativeFieldProperty.h"
#include "ConstantValue.h"

class CGSharpPropertyList;
class CType;

class WHENGINE_API CGSharpFieldProperty : public CProperty
{
public:	
	CGSharpFieldProperty(
		CGSharpPropertyList* InParentList
		,CString InName
		,const SDecoratedType & InType
        ,TMap<EPropertyFlags,  SReflectionMetaDataValue> InMetaData
		,bool InIsStatic
		,uint64_t InFieldIndex
		, bool InIsStruct
		, bool InIsEnum
		, TOptional<CConstantValue> InDefaultValue
		);

	// virtual const void* GetValuePointer(const void* InObjectPtr) override;
	// virtual void* GetValuePointer( void* InObjectPtr) override ;

	uint64_t GetFieldIndex() const { return FieldIndex; }

	TOptional<CConstantValue> GetDefaultValue() const { return DefaultValue; }
protected:
	//bool IsScriptFieldProperty() const override { return true; }

	//field index in the CGSharpFieldValuesContainer,
	//non-static and static field will not share the same index 
	//if the field is static, the index will be the index in the static field container
	//if the field is non-static, the index will be the index in the non-static field container
	uint64_t FieldIndex;

	//default value for static field
	TOptional<CConstantValue> DefaultValue;

};